<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
	</body>
</html>
<script type="text/javascript">
	function * gen(arg){
		console.log(arg);
		let one = yield 1;
		console.log(one);
		yield 2;
		console.log(arg);
		yield 3;
	}
	let iterator = gen('AAA');
	console.log(iterator.next());
	// next方法可以传入实参,作为yield语句返回结果
	console.log(iterator.next('BBB'));
	console.log(iterator.next());
	// console.log(iterator.next());
</script>